fixup! [CIR][LowerToLLVM] Fix crash in PtrStrideOp lowering#947
fixup! [CIR][LowerToLLVM] Fix crash in PtrStrideOp lowering#947
Conversation
|
This might be related to llvm/llvm-project#104668, which was reverted and relanded with a fix (with some further follow-ups going in). I'll make this a draft for now and come back to this during the next rebase. |
bcardosolopes
left a comment
There was a problem hiding this comment.
Ready to move out of draft (and merge)!
I'll see if this is still needed after the rebase I'm working on right now and revive it if needed :) |
|
I verified this is needed after the new trunk. |
After recent rebases, the LLVMIR stride operand can be generated by an unrealized_conversion_cast whereas the CIR operand is coming directly from a block argument (and thus has no defining op), so we need to separately check the CIR operand for the existence of a defining op. Fixes llvm#912
bf3a042 to
4a64124
Compare
|
I spent some time trying to understand this more. If you go back to the original introduction of this commit in 9720c61, both the LLVMIR and CIR versions of the stride are coming directly from a block argument, so I think that's related to llvm/llvm-project#101514. I'd misunderstood the follow-ups (such as llvm/llvm-project#107109 and llvm/llvm-project#106760) as removing |
After recent rebases (likely as a result of [1]), the LLVMIR stride
operand can be generated by an unrealized_conversion_cast whereas the
CIR operand is coming directly from a block argument (and thus has no
defining op), so we need to separately check the CIR operand for the
existence of a defining op.
[1] llvm/llvm-project@2d50029